package Service.impl;

import Service.IProductService;
import dao.IProductDao;
import dao.impl.ProductDaoImpl;
import pojo.Product;
import java.util.List;

public class ProductServiceImpl implements IProductService {
    IProductDao productDao=new ProductDaoImpl();
    @Override
    public void addProduct(Product product) {
        productDao.addProduct(product);
    }

    @Override
    public void updateProduct(Product product) {
        productDao.updateProduct(product);
    }

    @Override
    public void deleteProduct(int id) {
        productDao.deleteProduct(id);
    }

    @Override
    public Product findById(int id) {
        return productDao.findById(id);
    }

    @Override
    public List<Product> findAll() {
        return productDao.findAll();
    }

    @Override
    public List<Product> findByLikeName(String name) {
        return productDao.findByLikeName(name);
    }
}
